import javafx.scene.chart.BubbleChart;

import java.util.Arrays;
import java.util.Scanner;
public class practice {
    public static void main(String[] args) {
        int i,count = 0;
        System.out.println("请给定数组的大小");
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] arr = new int[n];
        System.out.println("请输入数组元素");
        for(i = 0;i < arr.length;i++){
            arr[i] =scanner.nextInt();
        }
        for (i = 0;i < arr.length;i++){
            if(i+2 < arr.length) {
                if (arr[i] % 2 != 0 && arr[i + 1] % 2 != 0 && arr[i + 2] % 2 != 0) {
                    count = 1;
                    System.out.println("ture");
                }
            }
        }
        if (count==0){
            System.out.println("false");
        }
    }
    public static void main7(String[] args) {
        int i = 0,count = 0;
        System.out.println("请给定数组的大小");
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] arr = new int[n];
        System.out.println("请输入数组元素");
        for(i = 0;i < arr.length;i++){
            arr[i] =scanner.nextInt();
        }
        for( i =0;i < arr.length;i++){
            count = 0;
            for(int j = 0;j < arr.length;j++){
                if(arr[i]==arr[j]){
                    count++;
                }
            }
            if(count > arr.length/2){
                System.out.println("找到了，多数元素为"+arr[i]);
                break;
            }else{
                System.out.println("找不到多数元素");
                return;
            }
       }
    }
    public static void main6(String[] args) {
        int[] arrint = {1,4,1,3,6,7,3,7,6};
        int ret = 0;
        for(int i = 0;i<arrint.length;i++){
            ret^=arrint[i];
        }
        System.out.println("单身狗为" + ret);
    }
    public static void coordinate(int[] array,int n){
        int flg = 0;
        for(int i = 0;i < array.length;i++){
            for (int j =i ;j < array.length;j++){
                if(array[i]+array[j] == n) {
                    flg = 1;
                    System.out.println("找到了,下标为[" + i + "," + j + "]");
                }
                if(flg == 1){
                    return;
                }
            }
        }
    }
    public static void main5(String[] args) {
        System.out.println("请输入你要查找的数字");
        int[] arr = {1,12,32,23,5,4,6,3};
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        coordinate(arr,n);

    }
    public static void  Bubble_sort(int[] array) {
        for (int i = 0; i < array.length - 1; i++) {
            for (int j = 0; j < array.length - i - 1; j++) {
                if (array[j] > array[j + 1]) {
                    int tmp = array[j];
                    array[j] = array[j + 1];
                    array[j + 1] = tmp;
                }
            }
        }
    }
    public static void main4(String[] args) {
        int[] arr = {1,32,4,7,5,6,56,9,10,8};
        Bubble_sort(arr);
        for(int x:arr){
            System.out.print(x+" ");
        }
    }
    public static int binary_search(int[] array,int n) {
        int left = 0;
        int right = array.length - 1;
        while (left <= right) {
            int mid = (left + right) / 2;
            if (array[mid] < n) {
                left++;
            }
            if (array[mid] > n) {
                right--;
            }
            if (array[mid] == n) {
                return mid;
            }
        }
        return -1;
    }
    public static void main3(String[] args) {
        System.out.println("请输入你要查找的数字");
        int[] arr ={1,2,5,8,9,16,17,21};
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int ret = binary_search(arr,n);
        if(ret > 0){
            System.out.println("找到了，下标为" + ret);
        }else{
            System.out.println("找不到");
        }
    }
    public static void adjust(int[] array){
        int left = 0;
        int right = array.length-1;
        while (right > left){
            if(array[left]%2 == 0 && array[right]%2 != 0){
                int tmp = array[right];
                array[right] = array[left];
                array[left] = tmp;
                right--;
                left++;
            }else if(array[left]%2 != 0&& array[right] % 2 == 0){
                right--;
            }else if(array[left]%2 != 0&&array[right]%2 != 0){
                left++;
            }
        }
   }
    public static void main2(String[] args) {
        int[] arr = {1,2,3,4,5,6,7,8,9};
        adjust(arr);
        for (int x: arr){
            System.out.print(x+" ");
        }

    }
    public static void transform(int[] array){
        for (int i = 0;i<array.length;i++){
            array[i] = array[i]*2;
        }
    }
    public static void main1(String[] args) {
        int[] arr = {1,2,3};
        transform(arr);
        String ret =Arrays.toString(arr);
        System.out.println(ret);
    }
}
